package cn.dataling.ai.common;

/**
 * @coder taoym
 * @datetime 2021/10/4 18:02
 * @desc
 */
public class ExceptionCore extends RuntimeException {
    /**
     * 状态码信息
     */
    private final ResponseStatusCodeEnum responseStatusCodeEnum;
    /**
     * 自定义信息
     */
    private final String msg;

    public ExceptionCore(ResponseStatusCodeEnum responseStatusCodeEnum) {
        super(responseStatusCodeEnum.getMsg());
        this.responseStatusCodeEnum = responseStatusCodeEnum;
        this.msg = null;
    }

    public ExceptionCore(String msg) {
        super(msg);
        this.responseStatusCodeEnum = ResponseStatusCodeEnum.FAIL;
        this.msg = msg;
    }

    public ResponseStatusCodeEnum getResponseStatusCode() {
        return responseStatusCodeEnum;
    }

    public String getMsg() {
        return msg;
    }
}
